home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / var / lib / dpkg / info / ucf.preinst < prev    next >
Encoding:
Text File  |  2009-08-13  |  2.9 KB  |  101 lines

  1. #! /bin/sh
  2. #                               -*- Mode: Sh -*-
  3. # preinst ---
  4. # Author           : Manoj Srivastava ( srivasta@glaurung.green-gryphon.com )
  5. # Created On       : Fri Nov 14 12:12:04 2003
  6. # Created On Node  : glaurung.green-gryphon.com
  7. # Last Modified By : Manoj Srivastava
  8. # Last Modified On : Tue Nov 18 22:35:57 2003
  9. # Last Machine Used: glaurung.green-gryphon.com
  10. # Update Count     : 4
  11. # Status           : Unknown, Use with caution!
  12. # HISTORY          :
  13. # Description      :
  14. #
  15. # arch-tag: d6a3672d-acb3-4f6c-9984-bad17d8ce0aa
  16. #
  17. # This program is free software; you can redistribute it and/or modify
  18. # it under the terms of the GNU General Public License as published by
  19. # the Free Software Foundation; either version 2 of the License, or
  20. # (at your option) any later version.
  21. #
  22. # This program is distributed in the hope that it will be useful,
  23. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  25. # GNU General Public License for more details.
  26. #
  27. # You should have received a copy of the GNU General Public License
  28. # along with this program; if not, write to the Free Software
  29. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  30. #
  31. #
  32.  
  33.  
  34. # Abort if any command returns an error value
  35. set -e
  36.  
  37. package_name=ucf
  38.  
  39. if [ -z "$package_name" ]; then
  40.     print >&2 "Internal Error. Please report a bug."
  41.     exit 1;
  42. fi
  43.  
  44.  
  45. statedir='/var/lib/ucf';
  46.  
  47. # This script is called before this version of this package is installed.
  48. # When this script is called, the package's files have not been unpacked
  49. # yet.
  50.  
  51. case "$1" in
  52.   install)
  53.     # About to install this package.
  54.     :
  55.  
  56.     # Add a diversion.  This is one of the few things which may be done
  57.     # before installing any files from the package.
  58.     # dpkg-divert --package foo --add --rename \
  59.     #             --divert /usr/bin/other.real /usr/bin/other
  60.  
  61.       echo >&2 "Moving old data out of the way"
  62.       for i in $(seq 6 -1 0); do
  63.       if [ -e "${statedir}/hashfile.${i}" ]; then
  64.           cp -f "${statedir}/hashfile.${i}" \
  65.           "${statedir}/hashfile.$(($i+1))"
  66.       fi
  67.       done
  68.       if [ -e "$statedir/hashfile" ]; then
  69.       cp -f "$statedir/hashfile"  "$statedir/hashfile.0"
  70.       fi
  71.  
  72.     # There are two sub-cases:
  73.     if test "${2+set}" = set; then
  74.       # The configuration files from version $2 of this package are
  75.       # still on the system.
  76.       :
  77.  
  78.     else
  79.       # There is no existing configuration; install from scratch.
  80.       :
  81.  
  82.     fi ;;
  83.   upgrade)
  84.     # About to upgrade this package from version $2 TO THIS VERSION.
  85.     # "prerm upgrade" has already been called for the old version of
  86.     # this package.
  87.     :
  88.  
  89.     ;;
  90.   abort-upgrade)
  91.     # Back out of an attempt to upgrade this package FROM THIS VERSION to
  92.     # version $2.  Undo the effects of "postrm upgrade $2".
  93.     :
  94.  
  95.     ;;
  96.   *) echo "$0: didn't understand being called with \`$1'" 1>&2
  97.      exit 0;;
  98. esac
  99.  
  100. exit 0
  101.